#include "CaseNode.h"

#include "ScriptCompiler/AST/SentenceBlockNode.h"
#include "ScriptCompiler/Token/Token.h"

bool CCaseNode::IsDefaultCase()
{ 
    return Case->Type == EScriptTokenType::Default; 
}

void CCaseNode::DebugPrint(int32_t InDepth)
{
    //print depth
    for (int32_t i = 0; i < InDepth; i++)
    {
        WH::Print(U"\t");
    }

    WH::Print(Case->ToString());

    if(!IsDefaultCase())
    {
        WH::Print(U" ");
        Condition.GetValue()->DebugPrint(0);
    }

    WH::Print(U":\n");
    Body->DebugPrint(InDepth+1);

}